package com.gagakuai.web.encript.domain;

/*
 * @program: hx-decript-springboot-starter
 * @description: 响应体 适配器
 * @author: houhong
 * @create: 2022-06-30 10:32
 */
public class BaseResponseApapter {


    private Integer status;
    private String msg;
    private Object obj;

    public static BaseResponseApapter build() {
        return new BaseResponseApapter();
    }

    public static BaseResponseApapter ok(String msg) {
        return new BaseResponseApapter(200, msg, null);
    }

    public static BaseResponseApapter ok(String msg, Object obj) {
        return new BaseResponseApapter(200, msg, obj);
    }

    public static BaseResponseApapter error(String msg) {
        return new BaseResponseApapter(500, msg, null);
    }

    public static BaseResponseApapter error(String msg, Object obj) {
        return new BaseResponseApapter(500, msg, obj);
    }

    private BaseResponseApapter() {
    }

    private BaseResponseApapter(Integer status, String msg, Object obj) {
        this.status = status;
        this.msg = msg;
        this.obj = obj;
    }

    public Integer getStatus() {
        return status;
    }

    public BaseResponseApapter setStatus(Integer status) {
        this.status = status;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public BaseResponseApapter setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Object getObj() {
        return obj;
    }

    public BaseResponseApapter setObj(Object obj) {
        this.obj = obj;
        return this;
    }

}